package com.langfeiyes.pattern.observer.demo;

public class ConcreteSubject  extends  Subject{

    private String state = "A状态";

    public void  changeState(String state){
        System.out.println("目标对象state状态发生变动了，由原来:"+ this.state + ",改为：" + state);
        this.state = state;

        //状态变动后通知所有观察者(订阅者)
        notifyObservers();
    }

    public String getState() {
        return state;
    }
}
